@include('admin.head')
<div class="container">
	<div class="row">
		@include('admin.side')
		<div class="col-md-10" id="content-wrapper">
			<div id="myTabContent" class="tab-content">
			 	<div class="tab-pane fade active in" id="home">
					<div class="row">
						<div class="col-xs-12">
							<div class=" clearfix">
								<div class="clearfix">
									<h2 class="pull-left">静态页面编辑</h2>
								</div>
								<div class="panel panel-default" id="base">
									<div class="panel-body">
										<div class="form-horizontal">
										  <fieldset>


										    <div class="form-group">
										      <label class="col-xs-4 control-label no_padding_right">网页名称:</label>
										      <div class="col-xs-4">
										        <input class="form-control input_size" name="name"  placeholder="" type="text">
										      </div>
										    </div>

										    <div class="form-group">
										      <label class="col-xs-4 control-label no_padding_right">开始时间:</label>
										      <div class="col-xs-4">
										        <input class="form-control input_size date-time-picker" readonly name="start_time" autocomplete="of" placeholder="" type="text">
										      </div>
										    </div>


										    <div class="form-group">
										      <label class="col-xs-4 control-label no_padding_right">更新时间:</label>
										      <div class="col-xs-4">
										        <input class="form-control input_size date-time-picker" readonly name="end_time" autocomplete="of" placeholder="" type="text">
										      </div>
										    </div>


											<div class="form-group">
										      <label class="col-xs-4 control-label no_padding_right">编辑人:</label>
										      <div class="col-xs-4">
										        <input class="form-control input_size" name="edit_people"  placeholder="" type="text">
										      </div>
										    </div>
										    <div class="form-group">
										      <div class="col-xs-12 text-center">
										      	<input type="hidden" name="did">
										        <button type="button" id="pro_sub" class="btn btn-primary ">提交</button>
										      </div>
										    </div>

										  </fieldset>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
			  	</div>
			</div>
		</div>
	</div>
</div>
@include("admin.footer")
@include("admin.common")
</body>




<script type="text/javascript">
var url = "<%url('admin')%>/";

var pid = "<%Input::get('pid')%>";
$.getq(que,url+ 'product/get_edit_product',{pid:pid},function(data){
	console.log(data);
	if(data.success){
		$("input[name='name']").val(data.data.name);
		$("input[name='start_time']").val(data.data.start_time);
		$("input[name='end_time']").val(data.data.end_time);
		$("input[name='edit_people']").val(data.data.edit_people);
	}
})

$("#pro_sub").click(function(){
	var name = $("input[name = 'name']").val().trim();
	var start_time = $("input[name = 'start_time']").val().trim();
	var end_time = $("input[name = 'end_time']").val().trim();
	var edit_people = $("input[name = 'edit_people']").val().trim();
	if(name =='' || start_time =='' || end_time == '' || edit_people =='' )
		{
			warning("不能为空！");
			return false;
		}

	$.post(url+"product/save_product",{
		pid : pid,
		name : name,
		start_time : start_time,
		end_time : end_time,
		edit_people : edit_people
	},function(data){
		if(data.success){
			success("","提交成功");
			setTimeout(function(){
				window.location.href="../staticpage";
			},1000)
		}
	})
})

</script>

</html>var